package com.zengqingfa.juc.n3;

import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;

/**
 * @fileName: TestIsDaemon
 * @author: zengqf3
 * @date: 2021-6-8 19:13
 * @description:
 */
@Slf4j(topic = "c.TestIsDaemon")
public class TestIsDaemon {

    public static void main(String[] args) throws Exception {
        log.debug("main start");
        Thread t1 = new Thread() {
            @SneakyThrows
            @Override
            public void run() {
                log.debug("t1 begin");
                Thread.sleep(5000);
                log.debug("t1 end");
            }
        };
        t1.setDaemon(true);
        t1.start();
        Thread.sleep(1000);
        log.debug("main end");
    }
}
